const envConfig = require('../env/env.config');
const env = process.env.NODE_ENV || 'local';
module.exports = {
  //获取所有语言资源文件
  getLang(req, res) {
    let langs = {};
    let defaultLang = envConfig[env].language.default;
    envConfig[env].language && envConfig[env].language.locales.map(key => {
      if (defaultLang == 'hk') {
        langs['cn'] = require("../lang/" + key + ".json");
      }
      else {
        langs[key] = require("../lang/" + key + ".json");
      }
    });
    res.json(langs);
  }
}